import com.demo.Controller.BeanLifeComponent;
import com.demo.Controller.UserController2;
import com.demo.Controller.UserController;
import com.demo.service.AService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring.xml");
        AService aService = context.getBean("AService",AService.class);
        aService.postConstruct();
    }
//    public static void main(String[] args) {
//        ClassPathXmlApplicationContext context =
//                new ClassPathXmlApplicationContext("spring.xml");
//        BeanLifeComponent life = context.getBean(BeanLifeComponent.class);
//        System.out.println("执⾏ main ⽅法");
//        context.destroy();
//    }
//    public static void main1(String[] args) {
//        ApplicationContext context =
//                new ClassPathXmlApplicationContext("spring.xml");
//        UserController user1 = context.getBean("userController", UserController.class);
//        user1.getUser();
//
//        UserController2 user2 = context.getBean("userController2", UserController2.class);
//        user2.getUser();
//    }
}
